
<?php get_main_menu("admin")?>
<?php
mysql_select_db($database_drycleaners_conn, $drycleaners_conn);
$query_get_branch = "SELECT branch.id, location.plot_no,
       location.town,
       location.village,
       branch.name
  FROM    drycleaners.branch branch
       INNER JOIN
          drycleaners.location location
       ON (branch.location_id = location.id)
	   WHERE branch.record_status='active'
	   ";
$get_branch = mysql_query($query_get_branch, $drycleaners_conn) or die(mysql_error());
$row_get_branch = mysql_fetch_assoc($get_branch);
$totalRows_get_branch = mysql_num_rows($get_branch);
?>
<?php include"includes/table_settings.php"?>
  <?php
 if($_REQUEST['branch_delete']==true && $_REQUEST['id']!=""){
 
 $query_remove_record="update branch set record_status='deactivated', deleted_by='".$loggedin_id."',  delete_date='".date("y-m-d")."' where branch.id='".$_REQUEST["id"]."'";
 
 mysql_query($query_remove_record,$drycleaners_conn) or die(mysql_error());
 if(mysql_affected_rows($drycleaners_conn)>0){
	 redirect_delete("branch_view","2",$_REQUEST["id"]);
	 }
 }
?>        
  <div>
  <a href="."><img src="images/back-button.png" width="30" height="30" title="Back" /></a><a href=".?branch_add&action=Add">
  <img src="images/add-button.jpg" width="30" height="30" title="Add <?php echo $object_name ?>" /></a></div> 
              <table cellpadding="0" cellspacing="0" border="0" id="dataTable">
                <thead>
                  <tr>
                    <th>Id</th>
                    <th>branch Name</th>
                    <th>Plot No.</th>
                    <th>Town</th>
                    <th>Village</th>
                    <th></th>
                    <th></th>
                  </tr>
                </thead>
                <tbody>
                  <!--Loop start, you could use a repeat region here-->
  <?php do{?>
    <!--Loop start, you could use a repeat region here-->
    <tr>
      <td><?php echo $row_get_branch['id']?></td>
      <td><?php echo $row_get_branch['name']?></td>
      <td><?php echo $row_get_branch['plot_no']?></td>
      <td><?php echo $row_get_branch['town']?></td>
      <td><?php echo $row_get_branch['village']?></td>
      <td><a href=".?branch= &amp;branch_edit= true&amp;id=<?php echo $row_get_branch['id']; ?>&action=Edit"><input name="" value="Edit" type="submit" id="edit_forms"/></a></td>
      <td><a href=".?branch_view&amp;branch_delete=true&id=<?php echo $row_get_branch['id']; ?>"><input name="" value="Delete" type="submit" id="delete_forms"/></a></td>
    </tr>
    <?php }while($row_get_branch=mysql_fetch_assoc($get_branch));?>
                  <!--Loop end-->
                </tbody>
              </table>
        	</div>
<div class="tab_column" id="form_area">
  </div>         
     	</div>     
</div>
</html><?php
mysql_free_result($get_branch);
?>